import 'package:flutter/material.dart';
import 'package:like_button/like_button.dart';

class Example07 extends StatefulWidget {
  @override
  _Example07State createState() => _Example07State();
}

class _Example07State extends State<Example07> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
          child: LikeButton(
            size: 30,
            circleColor:
            CircleColor(start: Color(0xff00ddff), end: Color(0xff0099cc)),
            bubblesColor: BubblesColor(
              dotPrimaryColor: Color(0xff33b5e5),
              dotSecondaryColor: Color(0xff0099cc),
            ),
            likeBuilder: (bool isLiked) {
              return Icon(
                Icons.home,
                color: isLiked ? Colors.deepPurpleAccent : Colors.grey,
                size: 30,
              );
            },
            likeCount: 1,
            countBuilder: (int count, bool isLiked, String text) {
              var color = isLiked ? Colors.deepPurpleAccent : Colors.grey;
              Widget result;
              if (count == 0) {
                result = Text(
                  "love",
                  style: TextStyle(color: color),
                );
              } else
                result = Text(
                  text,
                  style: TextStyle(color: color),
                );
              return result;
            },
          )),
    );
  }
}
